package com.zoe.app.config;

import cn.hutool.core.collection.CollUtil;
import com.zoe.app.filter.GlobalFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zoe.Zhang
 * @date 2022/06/09
 * @description
 */
@Configuration
public class FilterConfig {
    @Bean
    FilterRegistrationBean<GlobalFilter> filterFilterRegistrationBean() {
        FilterRegistrationBean<GlobalFilter> filterFilterRegistrationBean = new FilterRegistrationBean<>();
        filterFilterRegistrationBean.setFilter(new GlobalFilter());
        filterFilterRegistrationBean.setUrlPatterns(CollUtil.toList("/*"));
        return filterFilterRegistrationBean;
    }
}
